package name.elftesting.vncelf;

import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Test {
	public static void main(String args[]) throws InterruptedException,
			IOException {
		VncViewer v = new VncViewer();
		v.mainArgs = args;
		v.inAnApplet = false;
		v.inSeparateFrame = true;

		v.init();
		v.start();

		Thread.sleep(10000);
		Dimension di = v.vc.getSize();

		int width = v.vc.getWidth();
		int height = v.vc.getHeight();
		BufferedImage bi = new BufferedImage(width, height,
				BufferedImage.TYPE_INT_RGB);
		Graphics2D g = bi.createGraphics();
		v.canvasPanel.paint(g);
		ImageIO.write(bi, "jpg", new File("c:\\testvncscreen.jpg"));

		MouseEvent me = new MouseEvent(v.vc, MouseEvent.MOUSE_PRESSED, 0, 0,
				49, 850, 1, true, 1);

		v.vc.processLocalMouseEvent(me, false);
		me = new MouseEvent(v.vc, MouseEvent.MOUSE_RELEASED, 0, 0, 49, 850, 1,
				true, 1);
		v.vc.processLocalMouseEvent(me, false);

	}
}
